<?php
/* @var $this OrderController */
/* @var $model Order */

$this->breadcrumbs=array(
	'Orders'=>array('index'),
	$model->id,
);

$this->menu=array(
	array('label'=>'List Order', 'url'=>array('index')),
	array('label'=>'Create Order', 'url'=>array('create')),
	array('label'=>'Update Order', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Order', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Order', 'url'=>array('admin')),
);
?>

<h3>订单详情</h3>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		'createtime',
		'paytime',
		'finishtime',
		'orderStatus',
		'customer.username',
		'amount',
		'currency',
		'pay_type',
	),
)); 
echo "<hr />";
$dataProvider = $model->getOrderProductProvider();
$gridView = $this->widget('zii.widgets.grid.CGridView', array(
		'id'=>'product-grid',
		'cssFile'=>false,
		'emptyText'=>'未找到符合条件数据',
		'itemsCssClass'=>'table table-bordered table-hover',
		'dataProvider'=>$dataProvider,
		'summaryText'=>"",
		'columns'=>array(
				array(
						'name'=>'product.id',
						'header'=>'商品编号',
						'footer'=>'总计'
				),
				'product.name',
				array(
						'header'=>'商品图片',
						'type'=>'image',
						'name'=>'product.cover.realUrl'
				),
				array(
						'name'=>'amount',
						'value'=>'Utils::getCurrencyUnit("USD").$data->amount',
						'footer'=>$model->getFooter($dataProvider, 'amount')
				),
				array(
						'name'=>'num',
						'footer'=>$model->getFooter($dataProvider, 'num')
				),
				array(
						'name'=>'total',
						'footer'=>$model->getFooter($dataProvider, 'total')
				)
		),
));
?>
